/*
 * @Author: chenwll chenwell1025@163.com
 * @Date: 2024-11-01 09:39:59
 * @LastEditors: chenwll chenwell1025@163.com
 * @LastEditTime: 2024-11-01 15:35:35
 * @FilePath: \selecte:\chenwllCode\table\select-com\src\view\tableView\table.js
 * @Description: 
 */
/*
 * @Author: chenwll chenwell1025@163.com
 * @Date: 2024-10-31 17:28:26
 * @LastEditors: chenwll chenwell1025@163.com
 * @LastEditTime: 2024-11-01 15:19:38
 * @FilePath: \selecte:\chenwllCode\table\select-com\src\view\tableView\table.js
 * @Description:
 */

/**
 * 表格配置
 * @param {*} name: 表格名称
 * @param {*} prop: 表格字段&表格插槽
 * @param {*} width: 表格列宽度
 * @param {*} sort: 表格排序
 * @param {*} amount: 表格合计
 * @param {*} align: 表格对齐方式  left/center/right
 * @param {*} hide: 表格隐藏 true隐藏 false不隐藏
 * @param {*} type: 表格列类型 string字符串 number数字 date时间 默认string
 * @param {*} fixed: 表格列固定 left 左边固定  right 右边固定
 * @param {*} template: 表格操作列
 * @param {*} template.btn: 表格操作列按钮
 */
export const columns = [
  {
    name: '项目名称',
    prop: 'projectName',
    sort: true,
    align: 'left'
  },
  {
    name: '项目编码',
    prop: 'projectCode',
    width: 150,
    type:'number',
    sort: true,
    amount: true,
    align: 'right'
  },
  {
    name: '所属客户',
    prop: 'companyName',
    width: 150,
    align: 'center'
  },
  {
    name: '备注',
    prop: 'projectDesc',
    width: 150,
    hide: true
  },
  {
    name: '创建人',
    prop: 'createUserName',
    width: 120,
  },
  {
    name: '创建时间',
    prop: 'createTime',
    amount: true,
    type:'number',
    width: 140,
  },
  {
    name: '修改人',
    prop: 'updateUserName',
    width: 120,
  },
  {
    name: '修改时间',
    prop: 'updateTime',
    type: 'date',
    width: 140,
    sort: true, 
  },
  {
    name: '操作',
    width: 120,
    fixed: 'right',
    template: {
      type: 'btn',
      btn: [
        {
          label: '查看',
          event: 'handleDetails',
          type: 'text',
          icon: 'el-icon-view',
          hasPermi: ['settlement:project:getInfo'],
        },
        {
          label: '编辑',
          event: 'handleUpdate',
          type: 'text',
          icon: 'el-icon-edit-outline',
          hasPermi: ['settlement:project:update'],
        },
      ],
    },
  },
]

// 表格数据
export const rows = [
  {
    sid:1,
    projectName:'项目名称1',
    projectCode:1,
    companyName:'所属客户1',
    projectDesc:'备注1',
    createUserName:'创建人1',
    createTime:1730431280,
    updateUserName:'修改人',
    updateTime:1730431280,
    isCheck: true
  },
  {
    sid:2,
    projectName:'项目名称2',
    projectCode:2,
    companyName:'所属客户2',
    projectDesc:'备注2',
    createUserName:'创建人2',
    createTime:1730431280,
    updateUserName:'修改人2',
    updateTime:1730431280,
    isCheck: false
  },
  {
    sid:3,
    projectName:'项目名称3',
    projectCode:3,
    companyName:'所属客户3',
    projectDesc:'备注3',
    createUserName:'创建人3',
    createTime:1730431280,
    updateUserName:'修改人3',
    updateTime:1730431280,
    isCheck: true
  },
  {
    sid:4,
    projectName:'项目名称4',
    projectCode:4,
    companyName:'所属客户4',
    projectDesc:'备注4',
    createUserName:'创建人4',
    createTime:1730431280,
    updateUserName:'修改人4',
    updateTime:1730431242000,
    isCheck: true
  },
]
